﻿using System;


namespace Sencha.Serialization.Bson
{
	[TypeSerializer(typeof(Serializers.BsonMaxKeySerializer))]
	public sealed class BsonMaxKey : IEquatable<BsonMaxKey>
    {
		public static readonly BsonMaxKey Value = new BsonMaxKey();

        private BsonMaxKey()
        {
        }

		#region IEquatable<BsonMaxKey> Members

		public override bool Equals(object obj)
		{
			return (obj is BsonMaxKey);
		}

		public override int GetHashCode()
		{
			return base.GetHashCode();
		}

		public bool Equals(BsonMaxKey other)
		{
			return true;
		}

		#endregion

		public static bool operator ==(BsonMaxKey a, BsonMaxKey b)
		{
			if (ReferenceEquals(a, null) && ReferenceEquals(b, null))
				return false;
			else if (ReferenceEquals(a, null) || ReferenceEquals(b, null))
				return false;
			else
				return a.Equals(b);

		}
		public static bool operator !=(BsonMaxKey a, BsonMaxKey b)
		{
			return !(a == b);
		}

        public override string ToString()
        {
            return "maxkey";
        }
    }
}
